<template>
  <div v-show="dialogValue" class="add-page f-c">
    <BackPage title="投资项目办件信息" show-back @back="onPageBack" />
    <div class="add-form-box f-g">
      <el-form ref="formRef" :model="ruleForm" :rules="rules" label-position="top" class="user-add-form " inline disabled>
        <el-form-item label="办件编号" prop="approvalItemid">
          <el-input v-model="ruleForm.approvalItemid" clearable />
        </el-form-item>

        <el-form-item label="项目代码" prop="projectCode" style="margin-left: 64px">
          <el-input v-model="ruleForm.projectCode" clearable />
        </el-form-item>
        <el-form-item label="审批事项名称" prop="event">
          <el-input v-model="ruleForm.event" clearable />
        </el-form-item>
        <el-form-item label="所属区划代码" prop="divisionCode" style="margin-left: 64px">
          <el-input v-model="ruleForm.divisionCode" clearable />
        </el-form-item>
        <el-form-item label="当前办理状态" prop="statusName">
          <el-input v-model="ruleForm.statusName" clearable />
        </el-form-item>
        <el-form-item label="当前状态的时间" prop="handleTime" style="margin-left: 64px">
          <el-date-picker v-model="ruleForm.handleTime" />
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import { http_project1 } from '@/api'
import { project_nature, project_type } from '@/dict'

export default {
  name: 'User1Add',
  data() {
    return {
      dialogValue: false,
      ruleForm: {

      },
      rules: {
      },
      options2: project_nature,
      options3: project_type
    }
  },
  created() {

  },
  methods: {
    async open(item) {
      this.ruleForm = item
      this.dialogValue = true
    },
    onPageBack() {
      this.$emit('get-page')
      this.dialogValue = false
    },
    onSave() {
      this.$refs.formRef.validate(valid => {
        if (valid) {
          const formData = {
            ...this.ruleForm
          }
          http_project1[this.ruleForm.id ? 'update' : 'create']({
            ...formData
          }).then(res => {
            this.$message.success(res.msg)
            this.onPageBack()
          })
        }
      })
    }

  }
}
</script>

<style scoped lang="scss">
.add-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9;
  background-color: #F6F6F6;
}
.add-form-box {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid rgba(185, 185, 185, .3);
  border-radius: 16px;
  padding: 60px;
  ::v-deep .el-form {
    .el-form-item {
      width: calc((100% - 64px) / 2);
      margin-right: 0;
    }
    .el-select {
      width: 100%;
    }
  }
}
</style>
